//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS MQ service.
///
/// Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols.
public struct MQ: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the MQ client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "MQ",
            serviceIdentifier: "mq",
            serviceProtocol: .restjson,
            apiVersion: "2017-11-27",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: MQErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "mq-fips.us-east-1.amazonaws.com",
            "us-east-2": "mq-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "mq-fips.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "mq-fips.us-gov-west-1.amazonaws.com",
            "us-west-1": "mq-fips.us-west-1.amazonaws.com",
            "us-west-2": "mq-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates a broker. Note: This API is asynchronous. To create a broker, you must either use the AmazonMQFullAccess IAM policy or include the following EC2 permissions in your IAM policy. ec2:CreateNetworkInterface This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account. ec2:CreateNetworkInterfacePermission This permission is required to attach the ENI to the broker instance. ec2:DeleteNetworkInterface ec2:DeleteNetworkInterfacePermission ec2:DetachNetworkInterface ec2:DescribeInternetGateways ec2:DescribeNetworkInterfaces ec2:DescribeNetworkInterfacePermissions ec2:DescribeRouteTables ec2:DescribeSecurityGroups ec2:DescribeSubnets ec2:DescribeVpcs For more information, see Create an IAM User and Get Your Amazon Web Services Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide.
    @Sendable
    @inlinable
    public func createBroker(_ input: CreateBrokerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateBrokerResponse {
        try await self.client.execute(
            operation: "CreateBroker", 
            path: "/v1/brokers", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a broker. Note: This API is asynchronous. To create a broker, you must either use the AmazonMQFullAccess IAM policy or include the following EC2 permissions in your IAM policy. ec2:CreateNetworkInterface This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account. ec2:CreateNetworkInterfacePermission This permission is required to attach the ENI to the broker instance. ec2:DeleteNetworkInterface ec2:DeleteNetworkInterfacePermission ec2:DetachNetworkInterface ec2:DescribeInternetGateways ec2:DescribeNetworkInterfaces ec2:DescribeNetworkInterfacePermissions ec2:DescribeRouteTables ec2:DescribeSecurityGroups ec2:DescribeSubnets ec2:DescribeVpcs For more information, see Create an IAM User and Get Your Amazon Web Services Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide.
    ///
    /// Parameters:
    ///   - authenticationStrategy: Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
    ///   - autoMinorVersionUpgrade: Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Set to true by default, if no value is specified. Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above.
    ///   - brokerName: Required. The broker's name. This value must be unique in your Amazon Web Services account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters. Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data.
    ///   - configuration: A list of information about the configuration.
    ///   - creatorRequestId: The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action. We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency.
    ///   - dataReplicationMode: Defines whether this broker is a part of a data replication pair.
    ///   - dataReplicationPrimaryBrokerArn: The Amazon Resource Name (ARN) of the primary broker that is used to replicate data from in a data replication pair, and is applied to the replica broker. Must be set when dataReplicationMode is set to CRDR.
    ///   - deploymentMode: Required. The broker's deployment mode.
    ///   - encryptionOptions: Encryption options for the broker.
    ///   - engineType: Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.
    ///   - engineVersion: The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.
    ///   - hostInstanceType: Required. The broker's instance type.
    ///   - ldapServerMetadata: Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.
    ///   - logs: Enables Amazon CloudWatch logging for brokers.
    ///   - maintenanceWindowStartTime: The parameters that determine the WeeklyStartTime.
    ///   - publiclyAccessible: Enables connections from applications outside of the VPC that hosts the broker's subnets. Set to false by default, if no value is provided.
    ///   - securityGroups: The list of rules (1 minimum, 125 maximum) that authorize connections to brokers.
    ///   - storageType: The broker's storage type.
    ///   - subnetIds: The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ deployment has no subnet requirements when deployed with public accessibility. Deployment without public accessibility requires at least one subnet. If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your Amazon Web Services account. Amazon MQ will not be able to create VPC endpoints in VPCs that are not owned by your Amazon Web Services account.
    ///   - tags: Create tags when creating the broker.
    ///   - users: The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console.
    ///   - logger: Logger use during operation
    @inlinable
    public func createBroker(
        authenticationStrategy: AuthenticationStrategy? = nil,
        autoMinorVersionUpgrade: Bool? = nil,
        brokerName: String? = nil,
        configuration: ConfigurationId? = nil,
        creatorRequestId: String? = CreateBrokerRequest.idempotencyToken(),
        dataReplicationMode: DataReplicationMode? = nil,
        dataReplicationPrimaryBrokerArn: String? = nil,
        deploymentMode: DeploymentMode? = nil,
        encryptionOptions: EncryptionOptions? = nil,
        engineType: EngineType? = nil,
        engineVersion: String? = nil,
        hostInstanceType: String? = nil,
        ldapServerMetadata: LdapServerMetadataInput? = nil,
        logs: Logs? = nil,
        maintenanceWindowStartTime: WeeklyStartTime? = nil,
        publiclyAccessible: Bool? = nil,
        securityGroups: [String]? = nil,
        storageType: BrokerStorageType? = nil,
        subnetIds: [String]? = nil,
        tags: [String: String]? = nil,
        users: [User]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateBrokerResponse {
        let input = CreateBrokerRequest(
            authenticationStrategy: authenticationStrategy, 
            autoMinorVersionUpgrade: autoMinorVersionUpgrade, 
            brokerName: brokerName, 
            configuration: configuration, 
            creatorRequestId: creatorRequestId, 
            dataReplicationMode: dataReplicationMode, 
            dataReplicationPrimaryBrokerArn: dataReplicationPrimaryBrokerArn, 
            deploymentMode: deploymentMode, 
            encryptionOptions: encryptionOptions, 
            engineType: engineType, 
            engineVersion: engineVersion, 
            hostInstanceType: hostInstanceType, 
            ldapServerMetadata: ldapServerMetadata, 
            logs: logs, 
            maintenanceWindowStartTime: maintenanceWindowStartTime, 
            publiclyAccessible: publiclyAccessible, 
            securityGroups: securityGroups, 
            storageType: storageType, 
            subnetIds: subnetIds, 
            tags: tags, 
            users: users
        )
        return try await self.createBroker(input, logger: logger)
    }

    /// Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version).
    @Sendable
    @inlinable
    public func createConfiguration(_ input: CreateConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateConfigurationResponse {
        try await self.client.execute(
            operation: "CreateConfiguration", 
            path: "/v1/configurations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version).
    ///
    /// Parameters:
    ///   - authenticationStrategy: Optional. The authentication strategy associated with the configuration. The default is SIMPLE.
    ///   - engineType: Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.
    ///   - engineVersion: The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.
    ///   - name: Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long.
    ///   - tags: Create tags when creating the configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func createConfiguration(
        authenticationStrategy: AuthenticationStrategy? = nil,
        engineType: EngineType? = nil,
        engineVersion: String? = nil,
        name: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateConfigurationResponse {
        let input = CreateConfigurationRequest(
            authenticationStrategy: authenticationStrategy, 
            engineType: engineType, 
            engineVersion: engineVersion, 
            name: name, 
            tags: tags
        )
        return try await self.createConfiguration(input, logger: logger)
    }

    /// Add a tag to a resource.
    @Sendable
    @inlinable
    public func createTags(_ input: CreateTagsRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "CreateTags", 
            path: "/v1/tags/{ResourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Add a tag to a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource tag.
    ///   - tags: The key-value pair for the resource tag.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTags(
        resourceArn: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = CreateTagsRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.createTags(input, logger: logger)
    }

    /// Creates an ActiveMQ user. Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.
    @Sendable
    @inlinable
    public func createUser(_ input: CreateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateUserResponse {
        try await self.client.execute(
            operation: "CreateUser", 
            path: "/v1/brokers/{BrokerId}/users/{Username}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an ActiveMQ user. Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - consoleAccess: Enables access to the ActiveMQ Web Console for the ActiveMQ user.
    ///   - groups: The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
    ///   - password: Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).
    ///   - replicationUser: Defines if this user is intended for CRDR replication purposes.
    ///   - username: The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
    ///   - logger: Logger use during operation
    @inlinable
    public func createUser(
        brokerId: String,
        consoleAccess: Bool? = nil,
        groups: [String]? = nil,
        password: String? = nil,
        replicationUser: Bool? = nil,
        username: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateUserResponse {
        let input = CreateUserRequest(
            brokerId: brokerId, 
            consoleAccess: consoleAccess, 
            groups: groups, 
            password: password, 
            replicationUser: replicationUser, 
            username: username
        )
        return try await self.createUser(input, logger: logger)
    }

    /// Deletes a broker. Note: This API is asynchronous.
    @Sendable
    @inlinable
    public func deleteBroker(_ input: DeleteBrokerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteBrokerResponse {
        try await self.client.execute(
            operation: "DeleteBroker", 
            path: "/v1/brokers/{BrokerId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a broker. Note: This API is asynchronous.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteBroker(
        brokerId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteBrokerResponse {
        let input = DeleteBrokerRequest(
            brokerId: brokerId
        )
        return try await self.deleteBroker(input, logger: logger)
    }

    /// Deletes the specified configuration.
    @Sendable
    @inlinable
    public func deleteConfiguration(_ input: DeleteConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteConfigurationResponse {
        try await self.client.execute(
            operation: "DeleteConfiguration", 
            path: "/v1/configurations/{ConfigurationId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified configuration.
    ///
    /// Parameters:
    ///   - configurationId: The unique ID that Amazon MQ generates for the configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteConfiguration(
        configurationId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteConfigurationResponse {
        let input = DeleteConfigurationRequest(
            configurationId: configurationId
        )
        return try await self.deleteConfiguration(input, logger: logger)
    }

    /// Removes a tag from a resource.
    @Sendable
    @inlinable
    public func deleteTags(_ input: DeleteTagsRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteTags", 
            path: "/v1/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes a tag from a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource tag.
    ///   - tagKeys: An array of tag keys to delete
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTags(
        resourceArn: String,
        tagKeys: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteTagsRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.deleteTags(input, logger: logger)
    }

    /// Deletes an ActiveMQ user.
    @Sendable
    @inlinable
    public func deleteUser(_ input: DeleteUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteUserResponse {
        try await self.client.execute(
            operation: "DeleteUser", 
            path: "/v1/brokers/{BrokerId}/users/{Username}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an ActiveMQ user.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - username: The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteUser(
        brokerId: String,
        username: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteUserResponse {
        let input = DeleteUserRequest(
            brokerId: brokerId, 
            username: username
        )
        return try await self.deleteUser(input, logger: logger)
    }

    /// Returns information about the specified broker.
    @Sendable
    @inlinable
    public func describeBroker(_ input: DescribeBrokerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeBrokerResponse {
        try await self.client.execute(
            operation: "DescribeBroker", 
            path: "/v1/brokers/{BrokerId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about the specified broker.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeBroker(
        brokerId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeBrokerResponse {
        let input = DescribeBrokerRequest(
            brokerId: brokerId
        )
        return try await self.describeBroker(input, logger: logger)
    }

    /// Describe available engine types and versions.
    @Sendable
    @inlinable
    public func describeBrokerEngineTypes(_ input: DescribeBrokerEngineTypesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeBrokerEngineTypesResponse {
        try await self.client.execute(
            operation: "DescribeBrokerEngineTypes", 
            path: "/v1/broker-engine-types", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describe available engine types and versions.
    ///
    /// Parameters:
    ///   - engineType: Filter response by engine type.
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - nextToken: The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeBrokerEngineTypes(
        engineType: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeBrokerEngineTypesResponse {
        let input = DescribeBrokerEngineTypesRequest(
            engineType: engineType, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.describeBrokerEngineTypes(input, logger: logger)
    }

    /// Describe available broker instance options.
    @Sendable
    @inlinable
    public func describeBrokerInstanceOptions(_ input: DescribeBrokerInstanceOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeBrokerInstanceOptionsResponse {
        try await self.client.execute(
            operation: "DescribeBrokerInstanceOptions", 
            path: "/v1/broker-instance-options", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describe available broker instance options.
    ///
    /// Parameters:
    ///   - engineType: Filter response by engine type.
    ///   - hostInstanceType: Filter response by host instance type.
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - nextToken: The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.
    ///   - storageType: Filter response by storage type.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeBrokerInstanceOptions(
        engineType: String? = nil,
        hostInstanceType: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        storageType: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeBrokerInstanceOptionsResponse {
        let input = DescribeBrokerInstanceOptionsRequest(
            engineType: engineType, 
            hostInstanceType: hostInstanceType, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            storageType: storageType
        )
        return try await self.describeBrokerInstanceOptions(input, logger: logger)
    }

    /// Returns information about the specified configuration.
    @Sendable
    @inlinable
    public func describeConfiguration(_ input: DescribeConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeConfigurationResponse {
        try await self.client.execute(
            operation: "DescribeConfiguration", 
            path: "/v1/configurations/{ConfigurationId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about the specified configuration.
    ///
    /// Parameters:
    ///   - configurationId: The unique ID that Amazon MQ generates for the configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeConfiguration(
        configurationId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeConfigurationResponse {
        let input = DescribeConfigurationRequest(
            configurationId: configurationId
        )
        return try await self.describeConfiguration(input, logger: logger)
    }

    /// Returns the specified configuration revision for the specified configuration.
    @Sendable
    @inlinable
    public func describeConfigurationRevision(_ input: DescribeConfigurationRevisionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeConfigurationRevisionResponse {
        try await self.client.execute(
            operation: "DescribeConfigurationRevision", 
            path: "/v1/configurations/{ConfigurationId}/revisions/{ConfigurationRevision}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the specified configuration revision for the specified configuration.
    ///
    /// Parameters:
    ///   - configurationId: The unique ID that Amazon MQ generates for the configuration.
    ///   - configurationRevision: The revision of the configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeConfigurationRevision(
        configurationId: String,
        configurationRevision: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeConfigurationRevisionResponse {
        let input = DescribeConfigurationRevisionRequest(
            configurationId: configurationId, 
            configurationRevision: configurationRevision
        )
        return try await self.describeConfigurationRevision(input, logger: logger)
    }

    /// Returns information about an ActiveMQ user.
    @Sendable
    @inlinable
    public func describeUser(_ input: DescribeUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeUserResponse {
        try await self.client.execute(
            operation: "DescribeUser", 
            path: "/v1/brokers/{BrokerId}/users/{Username}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about an ActiveMQ user.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - username: The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeUser(
        brokerId: String,
        username: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeUserResponse {
        let input = DescribeUserRequest(
            brokerId: brokerId, 
            username: username
        )
        return try await self.describeUser(input, logger: logger)
    }

    /// Returns a list of all brokers.
    @Sendable
    @inlinable
    public func listBrokers(_ input: ListBrokersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListBrokersResponse {
        try await self.client.execute(
            operation: "ListBrokers", 
            path: "/v1/brokers", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of all brokers.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - nextToken: The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.
    ///   - logger: Logger use during operation
    @inlinable
    public func listBrokers(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListBrokersResponse {
        let input = ListBrokersRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listBrokers(input, logger: logger)
    }

    /// Returns a list of all revisions for the specified configuration.
    @Sendable
    @inlinable
    public func listConfigurationRevisions(_ input: ListConfigurationRevisionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListConfigurationRevisionsResponse {
        try await self.client.execute(
            operation: "ListConfigurationRevisions", 
            path: "/v1/configurations/{ConfigurationId}/revisions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of all revisions for the specified configuration.
    ///
    /// Parameters:
    ///   - configurationId: The unique ID that Amazon MQ generates for the configuration.
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - nextToken: The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.
    ///   - logger: Logger use during operation
    @inlinable
    public func listConfigurationRevisions(
        configurationId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListConfigurationRevisionsResponse {
        let input = ListConfigurationRevisionsRequest(
            configurationId: configurationId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listConfigurationRevisions(input, logger: logger)
    }

    /// Returns a list of all configurations.
    @Sendable
    @inlinable
    public func listConfigurations(_ input: ListConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListConfigurationsResponse {
        try await self.client.execute(
            operation: "ListConfigurations", 
            path: "/v1/configurations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of all configurations.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - nextToken: The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.
    ///   - logger: Logger use during operation
    @inlinable
    public func listConfigurations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListConfigurationsResponse {
        let input = ListConfigurationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listConfigurations(input, logger: logger)
    }

    /// Lists tags for a resource.
    @Sendable
    @inlinable
    public func listTags(_ input: ListTagsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsResponse {
        try await self.client.execute(
            operation: "ListTags", 
            path: "/v1/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists tags for a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource tag.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTags(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsResponse {
        let input = ListTagsRequest(
            resourceArn: resourceArn
        )
        return try await self.listTags(input, logger: logger)
    }

    /// Returns a list of all ActiveMQ users.
    @Sendable
    @inlinable
    public func listUsers(_ input: ListUsersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListUsersResponse {
        try await self.client.execute(
            operation: "ListUsers", 
            path: "/v1/brokers/{BrokerId}/users", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of all ActiveMQ users.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - nextToken: The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.
    ///   - logger: Logger use during operation
    @inlinable
    public func listUsers(
        brokerId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListUsersResponse {
        let input = ListUsersRequest(
            brokerId: brokerId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listUsers(input, logger: logger)
    }

    /// Promotes a data replication replica broker to the primary broker role.
    @Sendable
    @inlinable
    public func promote(_ input: PromoteRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PromoteResponse {
        try await self.client.execute(
            operation: "Promote", 
            path: "/v1/brokers/{BrokerId}/promote", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Promotes a data replication replica broker to the primary broker role.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - mode: The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.
    ///   - logger: Logger use during operation
    @inlinable
    public func promote(
        brokerId: String,
        mode: PromoteMode? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PromoteResponse {
        let input = PromoteRequest(
            brokerId: brokerId, 
            mode: mode
        )
        return try await self.promote(input, logger: logger)
    }

    /// Reboots a broker. Note: This API is asynchronous.
    @Sendable
    @inlinable
    public func rebootBroker(_ input: RebootBrokerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RebootBrokerResponse {
        try await self.client.execute(
            operation: "RebootBroker", 
            path: "/v1/brokers/{BrokerId}/reboot", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Reboots a broker. Note: This API is asynchronous.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - logger: Logger use during operation
    @inlinable
    public func rebootBroker(
        brokerId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RebootBrokerResponse {
        let input = RebootBrokerRequest(
            brokerId: brokerId
        )
        return try await self.rebootBroker(input, logger: logger)
    }

    /// Adds a pending configuration change to a broker.
    @Sendable
    @inlinable
    public func updateBroker(_ input: UpdateBrokerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateBrokerResponse {
        try await self.client.execute(
            operation: "UpdateBroker", 
            path: "/v1/brokers/{BrokerId}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds a pending configuration change to a broker.
    ///
    /// Parameters:
    ///   - authenticationStrategy: Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
    ///   - autoMinorVersionUpgrade: Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above.
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - configuration: A list of information about the configuration.
    ///   - dataReplicationMode: Defines whether this broker is a part of a data replication pair.
    ///   - engineVersion: The broker engine version. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide. When upgrading to ActiveMQ version 5.18 and above or RabbitMQ version 3.13 and above, you must have autoMinorVersionUpgrade set to true for the broker.
    ///   - hostInstanceType: The broker's host instance type to upgrade to. For a list of supported instance types, see Broker instance types.
    ///   - ldapServerMetadata: Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.
    ///   - logs: Enables Amazon CloudWatch logging for brokers.
    ///   - maintenanceWindowStartTime: The parameters that determine the WeeklyStartTime.
    ///   - securityGroups: The list of security groups (1 minimum, 5 maximum) that authorizes connections to brokers.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateBroker(
        authenticationStrategy: AuthenticationStrategy? = nil,
        autoMinorVersionUpgrade: Bool? = nil,
        brokerId: String,
        configuration: ConfigurationId? = nil,
        dataReplicationMode: DataReplicationMode? = nil,
        engineVersion: String? = nil,
        hostInstanceType: String? = nil,
        ldapServerMetadata: LdapServerMetadataInput? = nil,
        logs: Logs? = nil,
        maintenanceWindowStartTime: WeeklyStartTime? = nil,
        securityGroups: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateBrokerResponse {
        let input = UpdateBrokerRequest(
            authenticationStrategy: authenticationStrategy, 
            autoMinorVersionUpgrade: autoMinorVersionUpgrade, 
            brokerId: brokerId, 
            configuration: configuration, 
            dataReplicationMode: dataReplicationMode, 
            engineVersion: engineVersion, 
            hostInstanceType: hostInstanceType, 
            ldapServerMetadata: ldapServerMetadata, 
            logs: logs, 
            maintenanceWindowStartTime: maintenanceWindowStartTime, 
            securityGroups: securityGroups
        )
        return try await self.updateBroker(input, logger: logger)
    }

    /// Updates the specified configuration.
    @Sendable
    @inlinable
    public func updateConfiguration(_ input: UpdateConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateConfigurationResponse {
        try await self.client.execute(
            operation: "UpdateConfiguration", 
            path: "/v1/configurations/{ConfigurationId}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the specified configuration.
    ///
    /// Parameters:
    ///   - configurationId: The unique ID that Amazon MQ generates for the configuration.
    ///   - data: Amazon MQ for Active MQ: The base64-encoded XML configuration. Amazon MQ for RabbitMQ: the base64-encoded Cuttlefish configuration.
    ///   - description: The description of the configuration.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateConfiguration(
        configurationId: String,
        data: String? = nil,
        description: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateConfigurationResponse {
        let input = UpdateConfigurationRequest(
            configurationId: configurationId, 
            data: data, 
            description: description
        )
        return try await self.updateConfiguration(input, logger: logger)
    }

    /// Updates the information for an ActiveMQ user.
    @Sendable
    @inlinable
    public func updateUser(_ input: UpdateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateUserResponse {
        try await self.client.execute(
            operation: "UpdateUser", 
            path: "/v1/brokers/{BrokerId}/users/{Username}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the information for an ActiveMQ user.
    ///
    /// Parameters:
    ///   - brokerId: The unique ID that Amazon MQ generates for the broker.
    ///   - consoleAccess: Enables access to the the ActiveMQ Web Console for the ActiveMQ user.
    ///   - groups: The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
    ///   - password: The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).
    ///   - replicationUser: Defines whether the user is intended for data replication.
    ///   - username: The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateUser(
        brokerId: String,
        consoleAccess: Bool? = nil,
        groups: [String]? = nil,
        password: String? = nil,
        replicationUser: Bool? = nil,
        username: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateUserResponse {
        let input = UpdateUserRequest(
            brokerId: brokerId, 
            consoleAccess: consoleAccess, 
            groups: groups, 
            password: password, 
            replicationUser: replicationUser, 
            username: username
        )
        return try await self.updateUser(input, logger: logger)
    }
}

extension MQ {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: MQ, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MQ {
    /// Return PaginatorSequence for operation ``listBrokers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listBrokersPaginator(
        _ input: ListBrokersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListBrokersRequest, ListBrokersResponse> {
        return .init(
            input: input,
            command: self.listBrokers,
            inputKey: \ListBrokersRequest.nextToken,
            outputKey: \ListBrokersResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listBrokers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.
    ///   - logger: Logger used for logging
    @inlinable
    public func listBrokersPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListBrokersRequest, ListBrokersResponse> {
        let input = ListBrokersRequest(
            maxResults: maxResults
        )
        return self.listBrokersPaginator(input, logger: logger)
    }
}

extension MQ.ListBrokersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MQ.ListBrokersRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
